from services.base_common_service import BaseCommonService


class BaseProdCommonService(BaseCommonService):
    def db_config(self) -> dict[str, str]:
        from config.config import CONFIG
        c = CONFIG.get('prod')['mysql']
        return {
            'host': c['host'],
            'port': c['port'],
            'username': c['username'],
            'password': c['password'],
            'database': c['database'],
            'mysql_log': c['log_sql']
        }

    def __init__(self, model_class, time_field=None):
        assert model_class is not None, "model_class must be specified"
        assert time_field is not None, "time_field must be specified"

        super().__init__(model_class, time_field)
